package com.July.mapper;

import com.July.pojo.Department;
import com.July.pojo.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * @author July
 */
//员工Mapper
@Repository
@Mapper
public interface EmployeeMapper {
/*    //模拟数据库中数据
    private static Map<Integer, Employee> employees;
    @Autowired
    private DepartmentMapper departmentMapper;
    static {
        //创建一个部门表
        employees =new HashMap<Integer,Employee>();
        employees.put(1001,new Employee(1001,"AA","A919891266@qq.com",0,new Department(101,"教学部")));
        employees.put(1002,new Employee(1002,"BB","B919891266@qq.com",1,new Department(102,"市场部")));
        employees.put(1003,new Employee(1003,"CC","C919891266@qq.com",0,new Department(103,"教研部")));
        employees.put(1004,new Employee(1004,"DD","D919891266@qq.com",1,new Department(104,"运营部")));
        employees.put(1005,new Employee(1005,"EE","E919891266@qq.com",0,new Department(105,"后勤部")));
    }
    private static Integer initId=1006;*/



    //添加一个员工
    public void save(Employee employee);


    //查询所有员工信息
    public Collection<Employee> getAll();


    //通过id查询员工
    public Employee getEmployeeById(Integer id);

    //修改员工信息
    public void updateEmployee(Employee employee);
    //删除员工
    public void delEmployee(Integer id);
}
